﻿using Newtonsoft.Json;
using Newtonsoft.Json.Linq;

namespace MLSMooc.Helper
{
    public static class SerializeHelper
    {
        public static string SerializeJson(object obj)
        {
            return JsonConvert.SerializeObject(obj);
        }

        public static T DeSerializeObject<T>(string str)
        {
            return JsonConvert.DeserializeObject<T>(str);
        }

        public static JObject DeSerializeObject(string str)
        {
            return JsonConvert.DeserializeObject(str) as JObject;
        }
    }
}
